/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author Cheng
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '/@/api/model/baseModel';

const { adminPath } = useGlobSetting();

export interface AlarmInfo extends BasicModel<AlarmInfo> {
  deviceName?: string; // 设备名称
  deviceCode?: string; // 设备编号
  alarmType?: string; // 告警类型
  alarmTypeCode?: string; // 告警类型编号
  alarmName?: string; // 告警名称
  enterpriseName?: string; // 企业名称
  enterpriseCode?: string; // 企业编号
  reportTime?: string; // 上报时间
  assignTime?: string; // 分配时间
  createTime?: string; // 创建时间
  warningImage?: string; // 预警图片
  normalImage?: string; // 恢复正常图片
  handleStatus?: string; // 处理状态
  handlerName?: string; // 处理人姓名
  handlerId?: string; // 处理人ID
  leaveDuration?: string; // 离岗时长
}

export const alarmInfoList = (params?: AlarmInfo | any) =>
  defHttp.get<AlarmInfo>({ url: adminPath + '/security_alarm/alarmInfo/list', params });

export const alarmInfoListData = (params?: AlarmInfo | any) =>
  defHttp.post<Page<AlarmInfo>>({ url: adminPath + '/security_alarm/alarmInfo/listData', params });

export const alarmInfoForm = (params?: AlarmInfo | any) =>
  defHttp.get<AlarmInfo>({ url: adminPath + '/security_alarm/alarmInfo/form', params });

export const alarmInfoSave = (params?: any, data?: AlarmInfo | any) =>
  defHttp.postJson<AlarmInfo>({ url: adminPath + '/security_alarm/alarmInfo/save', params, data });

export const alarmInfoDelete = (params?: AlarmInfo | any) =>
  defHttp.get<AlarmInfo>({ url: adminPath + '/security_alarm/alarmInfo/delete', params });
